Methods For General Stabilizer-Based Quantum Computing Simulation

ABSTRACT

The disclosed method and computer-readable medium allow efficient simulation of both stabilizer and non-stabilizer states in general quantum circuits on a classical computer by maintaining global phases and orthogonalizing linear combinations of stabilizer states during simulation. This is accomplished by representing arbitrary quantum states as superpositions of stabilizer states, which may be implemented using one or more stabilizer frames. Each stabilizer frame includes a stabilizer matrix, one or more phase vectors corresponding to the stabilizer states, and an amplitude vector corresponding to the global phases of each stabilizer state. Orthogonality is maintained throughout the simulation for efficient computation and measurement. Some embodiments utilize a multiframe representation of the quantum state to reduce the number of stabilizer states required to represent the quantum state, which multiframe representation may also be used to implement parallel simulation.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No. 62/002,338, entitled “Methods For General Stabilizer-Based Quantum Computing Simulation,” which was filed on May 23, 2014, the entirety of which is incorporated by reference herein.

GOVERNMENT RIGHTS

This invention was made with government support under Grant No. FA8750-11-2-0043 from the United States Air Force Office of Scientific Research. The government has certain rights in the invention.

TECHNICAL FIELD

The invention relates generally to methods for simulating quantum computing operations on classical computers and, more particularly, to methods for efficiently simulating general quantum states by superposition of stabilizer states.

BACKGROUND

Quantum information processing manipulates quantum states rather than conventional 0-1 bits. It has been demonstrated with a variety of physical technologies (NMR, ion traps, Josephson junctions in superconductors, optics, etc.) and used in recently developed commercial products. Algorithms such as Shor's factoring algorithm and Grover's search algorithm apply the principles of quantum information to carry out certain computations asymptotically more efficiently than classical computers. Quantum computers hold great potential for complex computations in computational chemistry, biology, medicine, physics, and other fields. These developments have fueled research efforts to design, build and program scalable quantum computers. Due to the high volatility of quantum information, quantum error-correcting codes and effective fault-tolerant architectures are necessary to build reliable quantum computers. Most quantum algorithms are described in terms of quantum circuits and, similar to conventional digital circuits, require functional simulation to determine the best fault-tolerant design choices given limited resources. In particular, high-performance simulation is a key component in quantum design that facilitates analysis of trade-offs between performance and accuracy.

Simulating quantum circuits on a classical computer is a difficult problem. The matrices representing quantum gates, and the vectors that model quantum states grow exponentially with an increase in the number of qubits the quantum analogue of the classical computing bit. Several software packages have been developed for quantum circuit simulation including Oemer's Quantum Computation Language (QCL) and Viamontes' Quantum Information Decision Diagrams (QuIDD) implemented in the QuIDDPro package. While QCL simulates circuits directly using state vectors, QuIDDPro uses a variant of binary decision diagrams to store state vectors more compactly in some cases. Since the state-vector representation requires excessive computational resources in general, simulation-based reliability studies (e.g. fault injection analysis) of quantum fault-tolerant architectures using general-purpose simulators has been limited to small quantum circuits. Although certain stabilizer circuits have been identified and can be efficiently simulated on classical computers, the stabilizer circuits are of limited use. Stabilizer circuits must contain only stabilizer gates, which do not form a universal set for quantum computation. Therefore, stabilizer circuits alone do not permit efficient simulation of general quantum circuits.

SUMMARY

Disclosed herein are a method and computer-readable medium for the efficient simulation of quantum circuits using classical computers. One embodiment includes a method for maintaining global phases during simulation of at least one quantum gate of a quantum computer using a classical computer. The method includes the following: receiving a quantum state that is a superposition of a plurality of stabilizer states (wherein the quantum state is represented by a stabilizer matrix associated with the plurality of stabilizer states, a plurality of phase vectors representing each of the stabilizer states, and an amplitude vector with each entry in the amplitude vector representing a global phase associated with one of the plurality of phase vectors); receiving a matrix representation of the at least one quantum gate; and determining the effect of the at least one quantum gate on the quantum state in a plurality of iterations, each of which includes: applying one of the plurality of phase vectors to the stabilizer matrix, determining an input basis state associated with the one phase vector applied to the stabilizer matrix, determining an input non-zero amplitude associated with the input basis state, determining a first output non-zero amplitude associated with an output basis state by applying the matrix representation of the at least one quantum gate to the input non-zero amplitude and the input basis state, determining a second output non-zero amplitude of the output basis state using the stabilizer matrix and the matrix representation of the at least one quantum gate, and adjusting the entry in the amplitude vector associated with the one phase vector applied to the stabilizer matrix, wherein the entry is adjusted proportionally to the first output non-zero amplitude and the second output non-zero amplitude. Another embodiment includes a tangible, non-transitory computer-readable medium storing instructions for maintaining global phases during simulation of at least one quantum gate of a quantum computer using a classical computer that, when executed by one or more processors of the classical computer, cause the classical computer to perform corresponding operations.

In some embodiments of the method and computer-readable medium, at least one quantum gate of the quantum computer is not a stabilizer gate (i.e., the quantum gate is not a Hadamard, phase, or CNOT gate). In additional embodiments, the a set of the quantum gates may form a universal set for quantum computation (e.g., a set including a Hadamard gate and a Toffoli gate). In still further embodiments, the stabilizer matrix may be in canonical form, which greatly simplifies operations such as implementation of gates and measurement. Also to improve efficiency of the simulation, further embodiments may include compressing the received quantum state into a stabilizer frame (containing the stabilizer matrix, the plurality of phase vectors, and the amplitude vector), and then determining the effect of a plurality of the quantum gates on the quantum state using the stabilizer frame without uncompressing the stabilizer frame for measurement until the plurality of quantum gates have been applied to the quantum state. Thus, a general quantum circuit containing a plurality of (stabilizer or non-stabilizer) quantum gates may be simulated efficiently while the quantum state remains compressed (i.e., represented by a stabilizer frame). In additional embodiments, a linear combination of a plurality of mutually orthogonal stabilizer frames (i.e., a muliframe representation) may be used.

Another embodiment includes a method for orthogonalization of a linear combination of stabilizer states during simulation of a quantum circuit using a classical computer. The method includes the following: receiving a linear combination of stabilizer states (wherein the linear combination includes a plurality of stabilizer states represented by canonical stabilizer matrices and a plurality of coefficients associated with the plurality of stabilizer states); and orthogonalizing the linear combination of stabilizer states in each of one or more iterations, each of which includes: identifying a column in which at least two of the canonical stabilizer matrices contain different types of Pauli literals, decomposing each of the stabilizer matrices that contain an X or Y Pauli literal in the identified column into a first matrix and a second matrix (wherein the first matrix and the second matrix represent stabilizer states that are nearest neighbors of the stabilizer state associated with the decomposed stabilizer matrix), determining a first global phase factor of the first matrix and a second global phase factor of the second matrix associated with each of the decomposed stabilizer matrices, and replacing each of the decomposed stabilizer matrices and their associated coefficients with (i) the first matrix and a first coefficient proportionate to the first global phase factor associated with the decomposed stabilizer matrix and (ii) the second matrix and a second coefficient proportionate to the second global phase factor associated with the decomposed stabilizer matrix. Another embodiment includes a tangible, non-transitory computer-readable medium storing instructions for orthogonalization of a linear combination of stabilizer states during simulation of a quantum circuit using a classical computer that, when executed by one or more processors of the classical computer, cause the classical computer to perform corresponding operations.

In some embodiments, decomposing each of the stabilizer matrices may further include (i) identifying a row in the stabilizer matrix that contains an X or Y Pauli literal in the identified column, (ii) causing every other row in the stabilizer matrix that commutes with the identified row to anticommute with the identified row, (iii) creating the first matrix from the revised stabilizer matrix by replacing the row with a first new row containing a positive Z Pauli literal in the identified column, and (iv) creating the second matrix from the revised stabilizer matrix by replacing the row with a second new row containing a negative Z Pauli literal in the identified column. This will preserve the form of the stabilizer matrix and remove redundant literals.

In further embodiments, the linear combination of stabilizer states may comprise a linear combination of stabilizer frames representing a quantum state, and the method or computer readable medium may further determine the effect of at least one quantum gate on the linear combination of stabilizer states by applying a matrix representation of the quantum gate to each of the stabilizer frames. The one or more quantum gates may include at least one measurement gate, and determining the effect of the measurement gate may include determining an outcome probability of a state using normalized outcome probabilities of the state in each of the frames. In some embodiments, at least one of the quantum gates is not a stabilizer gate (i.e., the quantum gate is not a Hadamard, phase, or CNOT gate). In still further embodiments, the operations of the other embodiments may be implemented in parallel on at least two groups, with each of the groups containing at least one of the stabilizer frames.

BRIEF DESCRIPTION OF THE DRAWINGS

The figures described below depict various aspects of the applications, methods, and systems disclosed herein. It should be understood that each figure depicts an embodiment of a particular aspect of the disclosed applications, systems and methods, and that each of the figures is intended to accord with a possible embodiment thereof. Furthermore, wherever possible, the following description refers to the reference numerals included in the following figures, in which features depicted in multiple figures are designated with consistent reference numerals.

FIG. 1 illustrates an exemplary form of a stabilizer matrix in canonical form.

FIG. 2 illustrates an exemplary form of a stabilizer matrix in basis form.

FIG. 3 illustrates an exemplary stabilizer frame representing a quantum state as a superposition of stabilizer states.

FIG. 4 illustrates an exemplary simulation of the effect of a Toffoli gate on a quantum state using a stabilizer frame.

FIG. 5 illustrates a flow diagram of an exemplary global phase maintenance method.

FIG. 6 illustrates a flow diagram of an exemplary orthogonalization method.

FIG. 7 illustrates a flow diagram of an exemplary decomposition method.

FIG. 8 illustrates an exemplary multiframe representation of a quantum state.

FIG. 9 illustrates a flow diagram of an exemplary parallel simulation method.

FIG. 10 illustrates an exemplary block diagram of a computer system on which the methods and techniques described herein may be implemented in accordance with the described embodiments.

DETAILED DESCRIPTION

Although the following text sets forth a detailed description of numerous different embodiments, it should be understood that the legal scope of the invention is defined by the words of the claims set forth at the end of this patent. The detailed description is to be construed as exemplary only and does not describe every possible embodiment, as describing every possible embodiment would be impractical, if not impossible. One could implement numerous alternate embodiments, using either current technology or technology developed after the filing date of this patent, which would still fall within the scope of the claims.

It should also be understood that, unless a term is expressly defined in this patent using the sentence “As used herein, the term ‘______’ is hereby defined to mean . . . ” or a similar sentence, there is no intent to limit the meaning of that term, either expressly or by implication, beyond its plain or ordinary meaning (as would be understood by a person having ordinary skill in the art), and such term should not be interpreted to be limited in scope based on any statement made in any section of this patent (other than the language of the claims). To the extent that any term recited in the claims at the end of this patent is referred to in this patent in a manner consistent with a single meaning, that is done for sake of clarity only so as to not confuse the reader, and it is not intended that such claim term be limited, by implication or otherwise, to that single meaning. Finally, unless a claim element is defined by reciting the word “means” and a function without the recital of any structure, it is not intended that the scope of any claim element be interpreted based on the application of 35 U.S.C. §112(f).

As discussed above, the invention as described herein relates to the simulation of quantum computing circuits using a classical computer. As used herein, the term “classical computer” means any general use or specialized computer based on classical physics that processes data using one or more processors by implementing executable instructions stored in a computer-readable medium. This may include one or more personal computers, laptops, servers, or special-purpose computing devices. The term “classical computer” is used in contrast to quantum computers, which are based on quantum physics. Throughout this specification, actions not otherwise attributed to a device should be understood to be performed using a classical computer. In some embodiments, this may include implementation by a software program or module executed by the one or more processors of the one or more classical computers. Simulation of quantum circuits using classical computers is advantageous in the development and testing of quantum computers and related quantum computing devices. Additionally, or alternatively, the methods described herein may be useful in adapting algorithms developed for quantum computers for implementation on classical computers.

Stabilizer Circuits and States

Stabilizer circuits form an important subclass of quantum circuits that can be simulated efficiently on classical computers. Stabilizer circuits are exclusively composed of stabilizer gates—Hadamard (H), Phase (R), and controlled-NOT (CNOT) gates followed by one-qubit measurements in the computational basis. Such circuits may be applied to a computational basis state (e.g., |00 . . . 0)) to produce output states known as stabilizer states. Stabilizer states have extensive applications in quantum error-correcting codes and effective fault-tolerant architectures. Stabilizer circuits can be efficiently simulated in polynomial-time by keeping track of the Pauli operators that stabilize the quantum state. Such stabilizer operators are maintained during simulation and uniquely represent stabilizer states up to an unobservable global phase, significantly reducing the computational resources needed to simulate stabilizer circuits using vector-based representations. This represents an exponential improvement over vector-based quantum circuit simulations. Although the stabilizer operators obtain this increase in speed, the global phases of the computational states are not maintained numerically in such simulations. As described below, we develop a method of efficiently maintaining the global phase and expand the scope of circuits that can be simulated using stabilizer states.

We describe herein a generalization of the stabilizer formalism to admit simulation of non-stabilizer gates, such as Toffoli gates, possibly in addition to stabilizer gates. Unlike previous attempts to maintain quantum states as sums of density-matrix terms, we store quantum states as superpositions of pure stabilizer states, thus improving both memory usage and processing efficiency of the classical computer. Reducing memory requirements is important to quantum computing simulations because of the exponential growth of memory requirements in relation to the number of qubits in other simulation methods. Moreover, our approach results in improved efficiency of processing capacity of the classical computer, as described below with respect to improvements in processing runtime order of magnitude, as discussed below. Our approach allows more compact storage without the need to handle mixed stabilizer states. In order to simulate quantum states as superpositions of stabilizer states, however, it is necessary to maintain the global phases because the phases of the states become relative in our approach.

Quantum information processes, including quantum algorithms, are often modeled using quantum circuits and represented by diagrams. Quantum circuits are sequences of gate operations that act on some register of qubits—the basic unit of information in a quantum system. A single qubit is described by a quantum state |ψ

, which is a two-dimensional complex-valued vector. In contrast to classical bits, qubits can be in a superposition of the 0 and 1 states. Formally, |ψ

=α₀|0

+α₁|1

, where |0

=(1,0)^(T) and |1

=(0,1)^(T) are the two-dimensional computational basis states and α_(i) are probability amplitudes that satisfy |α₀|²+|α₁|²=1. An n-qubit register is the tensor product of n single qubits and thus is modeled by a complex vector |ψ

=|ψ₁

. . .

|ψ_(n)

=Σ_(i=0) ² ^(n) ⁻¹α_(i)|b_(i)

, where each b_(i) is a binary string representing the value i of each basis state. Furthermore, ψ^(n) satisfies Σ_(i=0) ² ^(n) ⁻¹|α_(i)|²=1. Each gate operation or quantum gate is a unitary matrix that operates on a small subset of the qubits in

${X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}},$

a register. For example, the quantum analogue of a NOT gate is the linear operator

${{\alpha_{0}\left. 00 \right)} + {\alpha_{1}\left. 10 \right)}}\overset{X \otimes I}{\mapsto}{{\alpha_{0}\left. 10 \right)} + {\alpha_{1}\left. 00 \right)}}$

Similarly, the two-qubit CNOT operator flips the second qubit (target) if and only if the first qubit (control) is set to 1, e.g.,

${{\alpha_{0}\left. 00 \right)} + {\alpha_{1}\left. 10 \right)}}\overset{C\; {NOT}}{\mapsto}{{\alpha_{0}\left. 00 \right)} + {\alpha_{1}\left. 11 \right)}}$

Another operator of particular importance is the Hadamard gate (H), which is frequently used to put a qubit in a superposition of computational-basis states, e.g.,

${{\alpha_{0}\left. 00 \right)} + {\alpha_{1}\left. 10 \right)}}\overset{I \otimes H}{\mapsto}\frac{\left. {\left. {\alpha_{0}\left( {\left. 00 \right) +} \middle| 01 \right)} \right) + {\alpha_{1}\left( \left| 10 \right. \right)} + \left. 11 \right)} \right)}{\sqrt{2}}$

It is important to note that the H gate generates unbiased superpositions in the sense that the squares of the absolute value of the amplitudes are equal. The final stabilizer gate is the phase gate (R), which applies a phase-shift factor of e^(i) if the qubit is in the |1> state. These three stabilizer gates may be represented in matrix form as follows:

$H = {\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & {- 1} \end{pmatrix}}$ $R = \begin{pmatrix} 1 & 0 \\ 0 &  \end{pmatrix}$ ${CNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}$

The dynamics involved in observing a quantum state are described by non-unitary measurement operators. There are different types of quantum measurements, including projective measurements in the computational basis (i.e., measurements with respect to the basis states, viz. the distances of the measured states from the |0

or |1

states). The corresponding measurement operators are

$P_{0} = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$

and

${P_{1} = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}},$

respectively. The probability p(x) of obtaining outcome xε{0,1} on the j^(th) qubit of state |ψ

is given by the inner product

ψ|P_(x) ^(j)|ψ, where

ψ| is the conjugate transpose of |ψ

. For example, the probability of obtaining |1

upon measuring |0

=α₀|0

+α₁|1

is

p(1)=(α*₀,α*₁)P ₁(α₀,α₁)^(T)=(0,α*₁)(α₀,α₁)^(T)=|α₁|²

The output states obtained after performing computational-basis measurements are called “cofactors,” and are states of the form |0

|ψ₀

and |1

|ψ1

. It is important to note that these states are orthogonal to each other and add up to the original state. We will use this property of cofactors extensively to represent states as superpositions of orthogonal stabilizer states. The norms of cofactors and the original state are subject to the Pythagorean theorem. We denote the |0

- and |1

-cofactors by |ψ^(c=0)

and |ψ^(c=1)

, respectively, where c is the index of the measured qubit. One can also consider iterated cofactors, such as double cofactors |ψ^(qr=00)

, |ψ^(qr=01)

, |ψ^(qr=10)

, and |ψ^(qr=11). Cofactoring with respect to all qubits produces amplitudes of individual basis vectors.

To simulate a quantum circuit C, we first initialize the quantum system to some desired state |ψ

(usually a basis state). |ψ

can be represented using a fixed-size data structure (e.g., an array of 2^(n) complex numbers) or a variable-size data structure (e.g., algebraic decision diagram). We then track the evolution of |ψ

via its internal representation as the gates in C are applied one at a time, eventually producing the output state C|ψ

. Most quantum-circuit simulators support some form of the linear-algebraic operations on matrix representations of quantum states. The drawback of such simulators is that their runtime and memory requirements grow exponentially with the number of qubits. This holds true not only in the worst case, but also in practical applications involving quantum arithmetic and quantum fault-tolerant circuits. Our approach improves the memory and runtime efficiency of such simulations using superposition of stabilizer states.

The stabilizer formalism presents a method of representing quantum states by keeping track of their symmetries, rather than their complex-valued vectors and amplitudes. The symmetries are linear operators for which the states are 1-eigenvectors. Algebraically, symmetries form group structures, which can be specified compactly by group generators. According to the stabilizer formalism, a unitary operator U stabilizes a state |ψ

if and only if |ψ

is a 1-eigenvector of the unitary operator U (i.e., U|ψ

=|ψ

). Several such stabilizer operators U can be derived from the Pauli matrices:

${X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}},{Y = \begin{pmatrix} 0 & {- } \\  & 0 \end{pmatrix}},$

and

$Z = {\begin{pmatrix} 1 & 0 \\ 0 & {- 1} \end{pmatrix}.}$

The one-qubit states stabilized by the Pauli matrices are:

-   -   X: (|0         +|1         )/√{square root over (2)} −X: (|0         −|1         )/√{square root over (2)}     -   Y: (|0         +i|1         )/√{square root over (2)} −Y: (|0         −i|1         )/√{square root over (2)}     -   Z: |0         −Z: |1         The identity matrix

$I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$

is also a stabilizer matrix for all states, but −I does not stabilize any state. As an example of the application of the stabilizer operators, the entangled state

$\frac{{00\rangle} + {11\rangle}}{\sqrt{2}}$

is stabilized by the Pauli operators and the identity matrix: X

X, Y

Y, Z

Z, and I

I.

Table I is a multiplication table of the Pauli operators X, Y, and Z and the identity matrix I. It should be noted that the Pauli matrices X, Y, and Z and the identity matrix I form a closed group under matrix multiplication with the multiplicative factors ±1 and ±1. Formally, the Pauli group g_(n) on n qubits consists of the n-fold tensor product of Pauli matrices, P=i^(k)P_(i)

. . .

P_(n) such that P_(j)ε{I,X,Y,Z} and kε{0,1,2,3}. The tensor-product symbol may be omitted for brevity, so P is denoted by a string of I, X, Y, or Z characters and a separate integer value k for the phase i^(k). As used herein, the term “Pauli literal” refers to any of the characters X, Y, or Z and the term “literal” refers to any of the characters I, X, Y, or Z. The string-integer pair representation allows us to compute the product of Pauli operators using the Pauli literals, without explicitly computing the tensor products because (A

B)(C

D)=(AC

BD) for matrices A, B, C, and D in the general case. For example, the product of four-qubit Pauli groups (−IIXI)(iIYII)=−iIYXI. Since |

_(n)|=4^(n+1),

_(n) can have at most log₂|

_(n)|=log₂ 4^(n+1)=2(n+1) irredundant generators. The stabilizer formalism is of particular importance because it allows simulations of quantum computers to represent an n-qubit quantum state |ψ

by its stabilizer group S(|ψ

), which is the subgroup of

_(n) that stabilizes |ψ

. If |S(|ψ

)=2^(n)|, then S(|ψ

) can have at most log₂|S(|ψ

)|=log₂ 2^(n)=n irredundant generators, so the group S(|ψ

) uniquely specifies |ψ

. Therefore, an arbitrary n-qubit stabilizer state can be represented by a stabilizer matrix

whose rows represent a set of generators Q₁, . . . , Q_(n) for S(|ψ

). As used herein, a “stabilizer matrix”

is a matrix whose rows represent a set of generators Q₁, . . . , Q_(n) for the stabilizer group S(|ψ

) for a state |

. Although we refer to stabilizer matrices and use matrix notation throughout, it should be understood that other equivalent representations may instead be used (e.g., graphs). Since each Q_(i)εS(|ψ

) is a string of n Pauli literals, the size of the stabilizer matrix

is n×n. Therefore, the storage cost of the stabilizer matrix

is O(n²) in the worst case, which is an exponential improvement over the up to O(2^(n)) storage cost of vector-based simulations. Furthermore, Q_(i)εS(|ψ

) implies that the leading phase of Q_(i) can only be ±1 and not ±i because Q_(i) ² cannot be −I, which does not stabilize any state. The phases of all of the generator vectors Q_(i) can thus be stored in a phase vector σ of n entries, with each entry representing either a + or a − phase.

TABLE I Multiplication table for Pauli matrices.

Shaded cells indicate anticommuting products.

Although stabilizer states are uniquely determined by their stabilizer groups

_(n), the sets of generators Q_(i) in the stabilizer matrices

may be selected in different ways. For example, the state

${\psi\rangle} = \frac{{00\rangle} + {11\rangle}}{\sqrt{2}}$

is uniquely specified by any of the following stabilizer matrices:

${\mathcal{M}_{1} = {\begin{matrix}  + \\  +  \end{matrix}\begin{bmatrix} X & X \\ Z & Z \end{bmatrix}}},{\mathcal{M}_{2} = {\begin{matrix}  + \\  -  \end{matrix}\begin{bmatrix} X & X \\ Y & Y \end{bmatrix}}},$

and

$\mathcal{M}_{1} = {{\begin{matrix}  - \\  +  \end{matrix}\begin{bmatrix} Y & Y \\ Z & Z \end{bmatrix}}.}$

₂ may be obtained from

₁ by row multiplication, and

₃ may be similarly obtained from

₁ or

₂. Multiplying any row by itself in these stabilizer matrices results in II, which stabilizes the state |ψ

. A row made up of only identity matrices I cannot be used as a generator Q_(i), however, because it is redundant and carries no information about the structure of |ψ

. Any stabilizer matrix

can be rearranged by elementary row operations to obtain a particular matrix structure, including reduced row echelon form (canonical form), without modifying the stabilizer state. Such elementary row operations include transposition (swapping the order of rows) and multiplication (left-multiplying a row by another row). Using Gaussian elimination, a stabilizer matrix

can be reduced to canonical form as illustrated in FIG. 1. The canonical form of a stabilizer matrix

contains an X-block and a Z-block, such that the X-block contains a minimal set of rows with X or Y Pauli literals. The Z-block contains rows that only include Z Pauli literals and I literals, and the Z-block likewise contains a minimal set of rows with Z Pauli literals. Additionally, the number of Pauli literals in each of the X-block and the Z-block is minimal. The X-block and the Z-block, respectively, contain an X-diagonal and a Z-diagonal. All Pauli X and Y literals are found on or above the X-diagonal within the X-block. Similarly, all Pauli Z literals are found on or above the Z-diagonal in the Z-block or in the X-block. Only I literals are found below the Z-diagonal within the Z-block.

In some embodiments, the Gaussian elimination procedure may implement the following Algorithm 1 in Table II to obtain the canonical form of the stabilizer matrix

. Algorithm 1 starts with the stabilizer matrix

and iteratively determines which row operations to apply based on the Pauli literals contained in the first row and column of an increasingly smaller submatrix A of the full stabilizer matrix

. After the appropriate row operations are applied to the submatrix A, the dimensions of the submatrix A are reduced for the next iteration. Algorithm 1 performs the process in two parts. First, the algorithm positions the X and Y Pauli literals at the top of the stabilizer matrix

. Second, the algorithm positions the Z Pauli literals at the bottom of the stabilizer matrix

. Specifically, take an n×n stabilizer matrix

, with rows indexed by iε{1, . . . , n} and columns indexed by jε{1, . . . , n}, where i and j are the indices associated with the first row and column, respectively, of the submatrix A. In each iteration of the first part of Algorithm 1, the following steps are iteratively performed. First, identify a row R_(k) with index kε{1, . . . , n} in the submatix A whose j^(th) literal is X or Y, and swap row R_(k) with row R_(i). Second, find any additional rows R_(m) with index mε{1, . . . , n} such that m≠i that has an X or Y Pauli literal in the j^(th) column, and left-multiply the row R_(m) by row R_(i) to set the j^(th) literal of row R_(m) to Z or I. Third, reduce the height of the submatrix A by one (i.e., set i=i+1), and reduce the width of the submatrix A by one (i.e., set j=j+1). Once the first part of Algorithm 1 is finished, the second part is iteratively performed to reduce the set of Z Pauli literals in the Z-block to the minimal set. Without resetting the row index i, the second part begins by resetting the column index j=1. The second part of the algorithm then iterates over j by implementing the following steps. First, identify a row R_(k) with index kε{1, . . . , n} in the submatix A whose j^(th) literal is Z, and swap row R_(k) with row R_(i). Second, find any additional rows R_(m) with index mε{1, . . . , n} such that m≠i that has an Z or Y Pauli literal in the j^(th) column, and left-multiply the row R_(m) by row R_(i) to ensure the columns of the canonical stabilizer matrix

have at most two distinct types of Pauli literals. Third, reduce the height of the submatrix A by one (i.e., set i=i+1), and reduce the width of the submatrix A by one (i.e., set j=j+1).

TABLE II Input: Stabilizer matrix 

 for S(|ψ 

 ) with rows R₁,...,R_(n) Output: M is reduced to row-echelon form

 ROWSWAP( 

 ,i,j) swaps rows R_(i) and R_(j) of 

 ROWMULT( 

 ,i,j) left-multiplies rows R_(i) and R_(j), returns updated R_(i)  1: i ← 1  2: for j ∈ {1,...,n} do

 Setup X block  3:  k ← index of row R_(k∈{i,...,n}) with j^(th) literal set to X(Y)  4:  if k exists then  5:   ROWSWAP( 

 ,i,k)  6:   for m ∈ {0,...,n} do  7:    if j^(th) literal of R_(m) is X or Y and m ≠ i then  8:     R_(m) = ROWMULT( 

 , R_(i), R_(m))

 Gauss-Jordan elimination step  9:    end if 10:   end for 11:   i ← i + 1 12:  end if 13: end for 14: for j ∈ {1,...,n} do

 Setup Z block 15:  k ← index of row R_(k∈{i,...,n}) with j^(th) literal set to Z 16:  if k exists then 17:   ROWSWAP( 

 ,i,k) 18:   for m ∈ {0,...,n} do 19:    if j^(th) literal of R_(m) is Z or Y and m ≠ i then 20:     R_(m) = ROWMULT( 

 , R_(i), R_(m))

 Gauss-Jordan elimination step 21:    end if 22:   end for 23:   i ← i + 1 24:  end if 25: end for

Using the canonical form of a stabilizer matrix

allows us to simulate quantum circuits efficiently (as described below) by maintaining the structure of the stabilizer matrix. For deterministic computational basis states (e.g., |00 . . . 0

), the canonical stabilizer matrix will contain only Z and I literals because each qubit is either |0

or |1

, but not a superposition. Therefore, a stabilizer matrix is in basis form if it has Z Pauli literals along its diagonal and I literals everywhere off its diagonal, combined with a phase vector σ. FIG. 2 illustrates the form of a stabilizer matrix in basis form. Because the basis state is deterministic, the basis form stabilizer matrix has only Z Pauli literals along its diagonal, and only I literals in every other position. The leading ± signs indicate the entries in the associated phase vector σ may be either + or − for each row. In this basis form, the ± sign of each row j and its corresponding Z_(j) literal designates whether the state of the j^(th) qubit in the basis state |ψ

associated with the stabilizer matrix

is |0

(+) or |1

(−).

To simulate a quantum circuit C containing a sequence of quantum gates UεC, the basis stabilizer matrix

corresponding to the basis state |ψ

is used. To simulate the action of each gate U, we conjugate each row Q_(i) of

by U. Since Q_(i)|ψ

=|ψ

, the resulting state U|ψ

is stabilized by UQ_(i)U† because (UQ_(i) U†)U|ψ

=UQ_(i)|ψ

=U|ψ

. In order to ensure that resulting output matrix M′ is a well-formed stabilizer matrix, it is necessary that UQ_(i)U† maps to another string of X, Y, Z, and 1-literals. The Hadamard (H), Phase (R), and controlled-NOT (CNOT) gates have such mappings. Table III lists the Pauli literal mappings for each of these gates. As an example of simulation using the stabilizer representation described above, the operation of a CNOT gate on a basis state of

${\psi\rangle} = \frac{{00\rangle} + {11\rangle}}{\sqrt{2}}$

can be represented as follows:

$\mathcal{M}_{\psi} = {{{\begin{matrix}  + \\  +  \end{matrix}\begin{bmatrix} X & X \\ Z & Z \end{bmatrix}}\overset{CNOT}{}\mathcal{M}_{\psi}^{\prime}} = {\begin{matrix}  + \\  +  \end{matrix}\begin{bmatrix} X & I \\ I & Z \end{bmatrix}}}$

It should be noted that the rows of the output matrix

′_(ψ) stabilizes

${{\psi\rangle}\overset{CNOT}{}\frac{{00\rangle} + {10\rangle}}{\sqrt{2}}}.$

TABLE III Conjugation of Pauli-group elements by stabilizer gates [18]. For the CNOT case, subscript 1 indicates the control and 2 the target. GATE INPUT OUTPUT GATE INPUT OUTPUT H X Z CNOT I₁ X₂ I₁ X₂ Y −Y X₁ I₂ X₁ X₂ Z X I₁ Y₂ Z₁ Y₂ P X Y Y₁ I₂ Y₁ X₂ Y −X I₁ Z₂ Z₁ Z₂ Z Z Z₁ I₂ Z₁ I₂

Since the H, R, and CNOT gates can be simulated directly using stabilizers, these gates are commonly called “stabilizer gates,” and circuits including only stabilizer gates are referred to as unitary “stabilizer circuits.” To simulate a stabilizer gate using a stabilizer matrix

, Table III of conjugations of Pauli-group elements by stabilizer gates indicates that at most two columns of the stabilizer matrix

must be updated. Thus, stabilizer gates are simulated in Θ(n) time. Furthermore, for any pair of Pauli operators A and B, ABA†=(−1)^(c)B̂t, where c=0 if A and B commute and c=1 otherwise. Thus, Pauli gates can also be simulated in linear time as they only permute the phase vector of the stabilizer matrix.

The stabilizer formalism also admits measurements in the computational basis and conveniently avoids direct computation of projection operators and inner products. Note that any qubit j in a stabilizer state is either in a state of |0

or |1

(a deterministic outcome) or in an unbiased superposition of both |0

and |1

(a random outcome). Deterministic and random outcomes may be differentiated in Θ(n) time by searching for X or Y Pauli literals in the j^(th) column of

. Where such X or Y literals are found, the j^(th) qubit must be in superposition, and the outcome is random with equal probability (e.g., (p(|0)=p(|1

)=0.5). Where such X or Y literals are not found, the j^(th) qubit is deterministic (e.g., p(|0)=1 or p(|1

)=1).

To measure the random outcome case, the j^(th) qubit may be updated using any known means of obtaining a random binary measurement (e.g., equivalent to the flip of an unbiased coin) may be used to obtain a deterministic outcome for the j^(th) qubit. For example, a random number generator may be used to determine whether the j^(th) qubit should be updated to |0

or |1

. In the stabilizer matrix

, this corresponds to replacing the row R_(j) with an X or Y literal in its j^(th) column with a row Z_(j) with a Z literal in its j^(th) column and I literals elsewhere. The phase of row Z_(j) is set in the phase vector σ of

to match the deterministic state of qubit j (e.g., |0

or |1

). Since rows R_(j) and Z_(j) anticommute, the stabilizer matrix

may then be examined for rows that anticommute with row Z_(j) and updated by multiplying such anticommuting rows by R_(j) to make them commute with row Z_(j). Alternatively, the rows of

that anticommute with Z_(j) may be updated prior to replacing row R_(j) with row Z_(j).

To measure the deterministic outcome case, the sign of the Z literal that stabilizes the qubit must be determined. In some embodiments, Gaussian elimination may be applied to reduce the stabilizer matrix

to row-echelon form. This removes redundant literals from the stabilizer matrix

, allowing identification of row Z_(j) with a Z literal in its j^(th) column and I literals elsewhere. Alternatively, if

is maintained in reduced row-echelon form, the row Z_(j) is simply identified. Once row Z_(j) is identified, the phase of the Z literal associated with the j^(th) qubit is determined from the corresponding entry in the phase vector σ.

In quantum mechanics, the states e^(iθ)|ψ

and |0

are considered phase-equivalent because e^(iθ) does not affect the statistics of measurement. Since the stabilizer formalism simulates stabilizer gates using their action by conjugation, such global phases are not maintained. For example, a basis state of |1

is stabilized by the literal −Z. Conjugation by the phase gate R yields R(−Z)R^(†), but the phase-vector representation

${1\rangle}\overset{R}{\rightarrow}{i{1\rangle}}$

indicates that the phase gate R applied to basis state |1

should yield i|1

. In this example, the global phase i is not maintained by the stabilizer formalism. Since global phases are unobservable, they do not need to be maintained when simulating a single stabilizer state. When dealing with superpositions of stabilizer states, however, the global phases must be maintained because the global phases become relative.

Stabilizer Frames

The stabilizer gates discussed above do not by themselves form a universal set for quantum computation. In some embodiments, therefore, simulation of a quantum computer may include at least one quantum gate of the quantum computer that is not a stabilizer gate. The Hadamard (H) and Toffoli (TOF) gates, for example, do form a universal set. The TOF gate is a 3-qubit gate that maps (c₁, c₂, t) to (c₁, c₂, t⊕(c₁c₂)), having the effect of a controlled-CNOT gate. The H gate is a stabilizer gate, but the TOF gate is not. To simulate TOF and other non-stabilizer gates, we extend the stabilizer formalism to include the representation of arbitrary quantum states as the superpositions of stabilizer states. Since computational basis states are stabilizer states, any one-qubit state |ψ

=α₁|0

+α₂|1

is a superposition of the two stabilizer states |0

and |1

. In general, any state decomposition in a computational basis state is a stabilizer decomposition. Note that if |ψ

is an unbiased superposition such that |α₁|²=|α₂|², then |ψ

can be represented using a single stabilizer state, up to a global phase. This underlies our method of identifying and compressing large unbiased superpositions on the fly during simulation to reduce resource requirements. To do this, we develop a simulation technique based on stabilizer frames of orthogonal stabilizer states.

As used herein, an n-qubit “stabilizer frame”

is a set of k≦2^(n) stabilizer states {|ψj

}_(j−1) ^(n) that forms an orthogonal subspace in the Hilbert space. The stabilizer frame

may be represented by a pair consisting of (i) the stabilizer matrix

and (ii) a set of distinct phase vectors {σ_(j)}_(j−1) ^(k). σ_(j=1) ^(k), where σ_(j)ε{±1}^(n). We denote the ordered assignment of the elements in phase vector σ_(j), as the (±1)-phases of the rows of

by matrix

^(σj). The size of the frame |

| is equal to k. To represent an arbitrary state | Ψ

using the frame

, we maintain an additional amplitude vector α=(α₁, . . . , α_(k)) of complex amplitudes corresponding to the decomposition of |Ψ

in the basis {|ψ_(j)

}_(j=1) ^(k) defined by the frame

, i.e., |Ψ

=Σ_(j=1) ^(k)α_(j)|ψ_(j)

and Σ_(j=1) ^(k)=|α_(j)|²=¹. Note that each amplitude α_(j) forms a pair with the corresponding phase vector σ₁ since |ψ_(j)

≡

^(σj).

Simulation using the stabilizer frames represents any state |Ψ

as a superposition of stabilizer states. For example, FIG. 3 represents a state |Ψ

=α(|00)+|01

)+α₂ (|10)+|11

) as a stabilizer frame

with stabilizer matrix

${\mathcal{M} = \begin{bmatrix} Z & I \\ I & X \end{bmatrix}},$

phase vectors 94 ₁=(+,+) and σ₂=(−, +), and amplitude vector α=(α₁, α₂). As noted above, the stabilizer matrix

can be combined with the set of phase vectors σ to obtain

$\mathcal{M}^{\sigma_{1}} = {\begin{matrix}  + \\  +  \end{matrix}\begin{bmatrix} Z & I \\ I & X \end{bmatrix}}$

and

$\mathcal{M}^{\sigma_{2}} = {{\begin{matrix}  + \\  +  \end{matrix}\begin{bmatrix} Z & I \\ I & X \end{bmatrix}}.}$

Note that, although the state |Ψ

has four computational basis amplitudes, the frame only has two phase vectors σ₁ and σ₂. Where |α₁|²=|α₂|², the frame

can be manipulated to reduce its size |

|, as discussed below.

As another example, the action of the TOF gate on an n-qubit state |Ψ

with control qubits c₁ and c₂ and target qubit t can be simulated using the frame

illustrated in FIG. 4. First, we decompose |Ψ

into all four of its double cofactors over the control qubits to obtain the following unbiased superposition of orthogonal states:

${\psi\rangle} = \frac{{\Psi^{{c_{1}c_{2}} = 00}\rangle} + {\Psi^{{c_{1}c_{2}} = 01}\rangle} + {{\Psi^{{c_{1}c_{2}} = 10}\rangle}{\Psi^{{c_{1}c_{2}} = 11}\rangle}}}{2}$

Then, the action of the TOF gate may be computed as follows:

TOF _(c) ₁ _(c) ₂ _(t)|ψ

=(|ψ^(c) ¹ ^(c) ² ⁼⁰⁰

+|ψ^(c) ¹ ^(c) ² ⁼⁰¹

+|ψ^(c) ¹ ^(c) ² ⁼¹⁰

+X _(t)|ψ^(c) ¹ ^(c) ² ⁼¹¹

)/2

where X_(t) is the Pauli X gate (corresponding to a NOT gate) acting on the target qubit t. As in the example above, each double cofactor |ψ_(c) ₁ _(c) ₂

is represented by the same stabilizer matrix

${\mathcal{M} = \begin{bmatrix} Z & I & I \\ I & Z & I \\ I & I & Z \end{bmatrix}},$

but each double cofactor |ψ_(c) ₁ _(c) ₂ ) has a distinct phase vector: σ_(c) ₁ _(c) ₂ ₌₀₀=(+, +, +), σ_(c) ₁ _(c) ₂ ₌₁₀=(−, +, +), σ_(c) ₁ _(c) ₂ ₌₀₁=(+, −, +), and σ_(c) ₁ _(c) ₂ ₌₁₁=(−, −, +). The four phase vector-stabilizer matrix combinations

σ c 1  c 2 = 00 , σ c 1  c 2 = 10 , σ c 1  c 2 = 01 , σ c 1  c 2 = 11

are also represented in FIG. 4. Note that the phase vector σ_(c) ₁ _(c) ₂ ₌₁₁ and the phase vector-stabilizer matrix combination

ℳ^(σ_(c₁c₂ = 11))

may be updated to simulate the action of the X_(t) gate. Thus, σ_(c) ₁ _(c) ₂ ₌₁₁=(−, −, −), and

$\mathcal{M}^{\sigma_{{c_{1}c_{2}} = 11}} = {{\begin{matrix}  - \\  - \\  -  \end{matrix}\begin{bmatrix} Z & I & I \\ I & Z & I \\ I & I & Z \end{bmatrix}}.}$

An amplitude vector α=(α_(c) ₁ _(c) ₂ ₌₀₀, α_(c) ₁ _(c) ₂ ₌₁₀, α_(c) ₁ _(c) ₂ ₌₀₁, α_(c) ₁ _(c) ₂ ₌₁₁) is likewise maintained. Enabling simulation of the TOF gate is particularly important because the TOF gate and the H gate form a universal set for quantum computation, and the H gate is a stabilizer gate.

Like the TOF gate, the controlled-phase gate R(α)_(ct) can also be simulated using stabilizer frames. The controlled-phase gate R(α)_(ct) applies a phase-shift factor of e^(iα) to a target qubit t if both the target qubit t and a control qubit c are set (i.e., c=1 and t=1). It is used with the H gate to implement the quantum Fourier transform circuit, which plays a key role in Shor's factoring algorithm. With cofactoring, the action of the R(α)_(ct) gate on a state |Ψ

may be computed as follows:

R(α)_(ct)|ψ

=(|ψ^(ct=00)

+|ψ^(ct=01)

+|ψ^(ct=10)

+e ^(iα)|ψ^(ct=11)

)/2

This can be simulated on a classical computer by cofactoring |Ψ

over the c and t qubits, determining the phase vectors σ_(j)ε{1, . . . , |

|}, and setting the amplitude vector αε{α₁, . . . , α_(|)

_(|)}. Then, for every phase vector σ_(j) corresponding to the |Ψ^(ct=11)

cofactor, shift the phase of the j^(th) qubit by setting α_(j)=α_(j)e^(iα). Note that this may result in a biased superposition.

Since the states in a stabilizer frame

are orthogonal, the outcome probability when measuring the output of a circuit simulated using the stabilizer frame

is equal to the sum of the outcome probabilities of each state |ψ_(i)

, normalized with respect to the entries in the amplitude vector α. Thus, for a superposition of states |Ψ

=Σ_(i)α_(i)|ψ_(i)

represented by

, the probability of observing an outcome xε{0,1} upon measuring qubit m is

${{p(x)}\phi} = {{\sum\limits_{i = 1}^{k}\; {{\alpha_{i}}^{2}{\langle\psi_{i}}P_{x}^{m}{\psi_{i}\rangle}}} = {\sum\limits_{i = 1}^{k}\; {{\alpha_{i}}^{2}{p(x)}\phi_{i}}}}$

where P_(x) ^(m) denotes the measurement operators P₀ and P₁ discussed above. As discussed above, the probability p(x)_(Ψ) can then be used to determine an outcome state |0

or |1

using a random number generator or other means of obtaining a binary outcome from a known probability. The frame

may then be cofactored such that only the states consistent with the measurement remain in the frame

.

Efficient Computation of Global Phases

As noted above, simulation of superpositions of stabilizer states using stabilizer frames requires tracking the relative global states of the stabilizer states. In quantum mechanics, the states e^(iθ)|ψ

and |ψ

are considered phase-equivalent because e^(iθ) does not affect the statistics of measurement. During stabilizer-based simulation, such global phases are not maintained. Since these phases are unobservable, this is not a problem when simulating a single stabilizer state. We manipulate superpositions of states, however, so the global phases become relative and must be maintained. As discussed above, we maintain the global phases of n-qubit states in stabilizer frames

using amplitude vectors α, such that each entry α_(j)ε{1, . . . , k} is a global phase corresponding to phase vector σ_(j) and stabilizer matrix

^(σj). To maintain the global phase when simulating quantum gate U, each global phase α_(j) is updated using a global phase maintenance method in accordance with the description herein.

FIG. 5 illustrates a flow diagram of an exemplary global phase maintenance method 500. The method 500 begins at block 502, when a representation of a quantum state |ψ

and a quantum gate U are received by a processor of a classical computer simulating a quantum circuit. The quantum state |ψ

and a quantum gate U may be stabilizer or non-stabilizer states or gates. The classical computer may then determine a stabilizer frame

representing the quantum state |ψ

as a superposition of stabilizer states at block 504. The stabilizer frame

includes one or more stabilizer matrices

, a plurality of phase vectors σ_(j) corresponding to the k stabilizer states in

, and an amplitude vector a corresponding to the phase vectors σ_(j). In some embodiments the quantum state |ψ

may be received as a stabilizer frame

, in which case block 504 may be removed. The classical computer then iterates through the stabilizer states in

for all jε{1, . . . , k}. At block 506, the classical computer determines whether the quantum gate U has been applied to each pair of phase vectors σ_(j)ε{1, . . . , k} and amplitudes α_(j)ε{1, . . . , k}. This may be accomplished by means of a for loop (e.g., with counter i=1, . . . , k) or by other known means. When the quantum gate U has been applied to all phase vectors σ_(j) (i.e., after k iterations), the implementation of the method 500 is complete. Prior to completion, blocks 508-518 are applied for each jε{1, . . . , k}.

At block 508, the classical computer sets the leading phases of stabilizer matrix

to the values in phase vector σ_(j) to produce stabilizer matrix

^(σj) for some jε{1, . . . , k} that has yet to be updated by application of the quantum gate U. Next, the classical computer determines an input basis state |b

of the matrix

^(σj) prior to application of the quantum gate U at block 510. Similarly, the non-zero amplitude of the basis state |b

is determined at block 512. At block 514, the classical computer computes the action of the quantum gate U on the basis state as U(β|b

)=β′|b′

via matrix-vector multiplication using the matrix representation of U and the vector representation of β|b

. The first output non-zero amplitude β′ is obtained from the output basis state |b′

and stored. At block 516, the classical computer determines a second non-zero amplitude γ of basis state |b′

from U

U†. Finally, the global phase α_(j) in the amplitude vector α is updated at block 518 as

$a_{j} = {\frac{a_{j}\beta^{\prime}}{\gamma}.}$

Where the quantum gate U is a Hadamard gate, the non-zero amplitude may be determined as the sum of a real and a complex non-zero amplitude in block 512. For example, where |ψ

=(|00

+|01

−i|10

−i|11

) (with the normalization factor omitted for simplicity), the generator set for

is {−YI,IX}. The orthonormal basis states |00

and i|10

are obtained from

, and the non-zero amplitude β=1 (the amplitude of |00

). The action of the H gate at block 514 is computed as

${{H_{1}\left( {{00\rangle} + {i{10\rangle}}} \right)} = {{\frac{\left( {1 - i} \right)}{\sqrt{2}}{00\rangle}} + {\frac{\left( {1 + i} \right)}{\sqrt{2}}{10\rangle}}}},$

so

$\beta^{\prime} = {\frac{\left( {1 - i} \right)}{\sqrt{2}}.}$

Then, at block 516, the amplitude of |00

is obtained from H₁

H₁†={YI,IX}, which yields γ=1. The global phase may then be adjusted by the global phase factor

$\frac{\beta^{\prime}}{\gamma \;} = {\frac{\left( {1 - i} \right)}{\sqrt{2}\;}.}$

In some embodiments, Gaussian elimination may be used to determine the non-zero amplitudes β, β′, and γ. In other embodiments, the non-zero amplitudes β, β′, and γ may be sampled from the leading phases σ_(j) and the literals of

where the stabilizer matrix

is in row-echelon form. Performing Gaussian elimination on all stabilizer matrices

in

requires O(n³|

|) time (in the worst case). Since stabilizer gates affect at most two columns of

, the stabilizer matrix

may be maintained in row-echelon form in the worst case in O(n²) time using row multiplication. Therefore, for the n-qubit stabilizer frame

, the overall runtime for simulating a single stabilizer gate is up to O(n²+n|

|), since the updates to

required to compute each α_(j) can be memorized using known techniques to avoid redundant computation. For this reason, it is advantageous to maintain the stabilizer matrix

in row-echelon form throughout the simulation.

Orthogonalization of Linearly Dependent Combinations of Stabilizer States

As discussed above, measurement of frames and other combinations of quantum states is simplified where the states are mutually orthogonal. To simulate measurements of an arbitrary state |Ψ

, therefore, it is helpful to transform the set of stabilizer states that represent |Ψ

into an orthogonal set. For any linear combination of stabilizer states |Ψ

=Σ_(j=1) ^(n)c_(j)|ψ_(j)

where each stabilizer state |ψ_(j)

is represented by its own stabilizer matrix, we can transform the stabilizer states |ψ

into an orthogonal basis by decomposition.

Since a linear combination of stabilizer states is not generally a stabilizer state, Gram-Schmidt orthogonalization cannot be use directly. Therefore, we develop an orthogonalization procedure that exploits the nearest-neighbor structure of stabilizer states and their efficient manipulation via stabilizers. As used herein, a stabilizer state |φ

is a “nearest-neighbor” of a stabilizer state |ψ

with ∥|ψ

∥=1 if and only if

${{\langle\left. \psi \middle| \phi \right.\rangle}} = {\frac{1}{\sqrt{2}}.}$

Where two orthogonal stabilizer states |α

and |β

have an unbiased superposition |ψ

that is also a stabilizer state, then

${{{\langle\left. \psi \middle| \alpha \right.\rangle}} = {{{\langle\left. \psi \middle| \beta \right.\rangle}} = \frac{1}{\sqrt{2}}}},$

so |α

and |β

are nearest neighbors of |ψ

. In general, any two stabilizer states have an equal number of nearest neighbor stabilizer states. Furthermore, any n-qubit stabilizer state |ψ

has 4(2^(n)−1) nearest-neighbor stabilizer states of the form

$\frac{\left( {{\psi\rangle} + {i^{l}{\phi\rangle}}} \right)}{\sqrt{2}},$

where lε{0,1,2,3} and where |ψ

and |φ

are orthogonal n-qubit stabilizer states. We can thus decompose |ψ

into a superposition of nearest-neighbor stabilizer states

$\frac{\left( {{\varphi\rangle} + {i^{l}{\phi\rangle}}} \right)}{\sqrt{2}}$

using Algorithm 2 in Table IV. Algorithm 2 takes as input a linear combination of n-qubit states represented by (i) a list of stabilizer matrices in canonical form M={

¹, . . . ,

^(N)} and (ii) a list of corresponding coefficients C={c₁, . . . , c_(N)}. Algorithm 2 iterates over the columns jε{1, . . . , n} to select pivot columns where the column j differs between two matrices

^(i)ε M in lines 1-10. When two matrices in M are found to differ in their, j^(th) columns, Algorithm 2 applies a decomposition procedure to all matrices

^(i)εM in lines 11-20, thereby making column j equivalent up to a phase-vector permutation in each of the matrices in M.

TABLE IV Input: Linear combination of n-qubit states |ψ 

 = Σ_(j=1) ^(N) c_(j)|ψ_(j) 

 represented by (i) a list of canonical stabilizer    matrices M = { 

 ¹,..., 

 ^(N)} and (ii) a list of coefficients C = {c₁,...,c_(N)} Output: Modified lists M′ and C′ representing a linear combination of mutually orthognal states

  PAULI(M,j) returns 0 if the j^(th) column in M has Z literals only (ignores 1 literals), 1 if it has X literals    only, 2 if it has Y literals only, 3 if it has X/Z literals only, and 4 if it has Y/Z literals only

  REMOVE(M,C,j) removes the j^(th) element in M and C

  INSERT(M,C, 

 ,c) appends 

 to M and c to C if an equivalent matrix does not exist in M: otherwise,    sets c_(j) = c_(j) + c, where c_(j) is the coefficient of the matrix in M that is equivalent to 

  DECOMPOSE( 

 ,j,a ∈ {0, 1}) implements the proof of Proposition 5.5 and returns the pair [ 

 _(j=a),α], where     

 _(j=a) is the nearest-neighbor canonical matrix with the j^(th) qubit in state |a), and α is the phase factor  1: for j ∈ {1,...,n} do  2:  b ← 0  3:  l ← PAULI( 

 ¹, j)  4:  for each  

 ^(i), i ∈ {2,...,N} do  5:   k ← PAULI( 

 ^(i), j)  6:   if k ≠ l or the rows with Pauli literals in the j^(th) column are distinct then  7:    b ← 1  8:    break  9:   end if 10:  end for 11:  if b = 1 then 12:   for each  

 ^(i), i ∈ {1,...,N} do 13:    [ 

 _(j=0) ^(i), α] ← DECOMPOSE( 

 ^(i), j, 0) 14:    [ 

 _(j=1) ^(i), β] ← DECOMPOSE( 

 ^(i), j, 1) 15:    REMOVE(M, C, i) 16:    INSERT(M, C, 

 _(j=0) ^(i), α/{square root over (2)}) 17:    INSERT(M, C, 

 _(j=1) ^(i), β/{square root over (2)}) 18:   end for 19:  end if 20: end for

FIG. 6 illustrates a flow diagram of an exemplary orthogonalization method 600. The method 600 begins at block 602 with the classical computer receiving a linear combination of stabilizer states represented by a list of stabilizer matrices in canonical form M={

¹, . . . ,

^(N)} and (ii) a list of corresponding coefficients C={c₁, . . . , c_(iv)}. In some embodiments the stabilizer states may be represented by one or more frames

or in another manner, in which case the classical computer may next determine the stabilizer matrices in M and coefficients in C from the linear combination of stabilizer states. Additionally, or alternatively, the stabilizer matrices in M may not be in canonical form, in which case the process described above or other known techniques may be used to put the matrices into canonical form. At block 604, the classical computer determines whether all matrices

^(i)εM are similar. As used herein, a plurality of stabilizer matrices are “similar” if the matrices are equivalent up to a phase-vector permutation. The classical computer may determine whether all matrices

^(i)εM are similar in a variety of ways, including comparing the matrices by known techniques. Alternatively, an iterative mechanism (e.g., a loop counter) may be used in some embodiments, such as the embodiment in Table V. When all matrices

^(i)εM are similar, the method 600 ends. Until all matrices

^(i)εM are similar, the classical computer iterates through blocks 604-616 to identify dissimilarities and decompose the dissimilar matrices into similar matrices.

In block 606, the classical computer identifies a pivot column by determining a column containing different types of Pauli literals in at least two matrices in M. In some embodiments, the process may compare the literals of a test column in each matrix

^(i)εM only until a first pair of matrices in M with different types of Pauli literals is identified using known techniques. Additionally, or alternatively, the classical computer may compare one or more columns in each matrix

^(i)εM until a column is located where two or more matrices in M differ either in the types of Pauli literals contained therein or in the rows in which the Pauli literals are located. Once a column j has been identified in block 606, the classical computer may identify one or more matrices

^(i)εM containing at least one X or Y Pauli literal in column j. Each matrix

^(i)εM is then decomposed into two of its nearest-neighbor stabilizer states at block 610.

FIG. 7 illustrates a flow diagram of an exemplary decomposition method 700 for decomposing state 10) represented by a matrix

^(i)εM with an X or Y Pauli literal in its j^(th) column into its two nearest-neighbor stabilizer states defined by

$\frac{\left( {{\varphi\rangle} + {i^{l}{\phi\rangle}}} \right)}{\sqrt{2}}.$

At block 702, a stabilizer matrix

^(i) with an X or Y literal in its j^(th) column is received. This may be the same matrix identified in block 608 of method 600. At block 704, the classical computer identifies one row R_(j) within the matrix

^(i) with an X or Y literal in its j^(th) column. It should be noted that the row R_(j) anticommutes with a Pauli operator Z_(j), which is a row vector containing a Z literal in its j^(th) column and I literals elsewhere. Since the stabilizer matrix

^(i) will be decomposed into two nearest neighbors of |ψ

by replacing R_(j) with ±Z_(j), any additional rows W_(j)≠R_(j) in

^(i) containing an X or Y literal in their j^(th) columns may be made to commute with Z_(j) by multiplication by R_(j). Thus, at block 706, the classical computer determines whether there is another row W_(j)≠R_(j) in matrix

^(i) that anticommutes with Pauli operator Z_(j). Where such a row is found, the classical computer multiplies the row W_(j) by the row R_(j) to make it commute with the Pauli operator Z_(j). Block 706 and 708 are repeated until no further rows W_(j) are found, at which point the matrix

^(i) is decomposed into two matrices representing orthogonal nearest-neighbor stabilizer states of |ψ

. At block 710, the classical computer decomposes the matrix

^(i)εM into a first matrix

^(Φ) by replacing the row R_(j) with Z_(j). At block 712, the classical computer similarly decomposes the matrix

^(i) into a second matrix

^(φ) by replacing the row R_(j) with the row −Z_(j). The steps implemented at blocks 710 and 712 are equivalent to applying ±Z_(j)-measurement projectors to |ψ

. Thus, the first matrix

^(Φ) and the second matrix

^(φ) represent the nearest-neighbor stabilizer states

${\varphi\rangle} = \frac{\left( {I + Z_{j}} \right){\psi\rangle}}{\sqrt{2}}$

and

${\phi\rangle} = {\frac{\left( {I - Z_{j}} \right){\psi\rangle}}{\sqrt{2}}.}$

It should be noted that the first and second matrices

^(Φ) and

^(φ) are similar and that

${{{\langle\left. \psi \middle| \varphi \right.\rangle}} = {{{\langle\left. \psi \middle| \phi \right.\rangle}} = \frac{1}{\sqrt{2}}}},$

so the first and second matrices

^(Φ) and

^(φ) are orthogonal. Additionally, the j^(th) qubits in |Φ

and |φ

are deterministic with states |0

and |1

, respectively. Thus, the state |ψ

represented by matrix

^(i) has been decomposed into orthogonal stabilizer states |Φ

and |φ

represented by the first and second matrices

^(Φ) and

^(φ), respectively. From the discussion above,

$\frac{\left( {{\varphi\rangle} + {i^{l}{\phi\rangle}}} \right)}{\sqrt{2}}$

represents a nearest-neighbor decomposition of |ψ

. To fully represent |ψ

by its decomposition, the global phase factor i^(l) is needed.

Returning to FIG. 6, at block 612, the global phase factors α and β of the first and second matrices

^(Φ) and

^(φ), respectively, are determined using the procedure described in the global phase maintenance method 500 as applied to the matrix

^(i) and coefficient c_(i). At block 614, the classical computer sets the coefficients c_(Φ)εC and c_(φ)εC of the first and second matrices

^(Φ) and

^(φ) as

$c_{\varphi} = \frac{\gamma}{\sqrt{2}}$

and

$c_{\varphi} = {\frac{\beta}{\sqrt{2}}.}$

At block 016, the classical computer replaces the matrix

^(i)εM and c_(i)εC with the first and second matrices

^(Φ) and

^(φ) and their respective coefficients c_(Φ) and c_(Φ). In some embodiments, the classical computer may determine whether either or both of the first and second matrices

^(Φ) and

^(φ) are equivalent to existing matrices

^(p)εM and

^(q)εM, respectively. If equivalent matrices

^(p) or

^(q) are found, then the classical computer may set the coefficients c_(p)=c_(p)+c_(φ) and c_(q)=c_(q)+c_(φ). Where either the first matrix

^(Φ) or the second matrix or

^(φ) is not equivalent to any matrix in M, then the first matrix

^(Φ) or the second matrix or

^(φ) is added to M and the respective coefficient c_(Φ) or c_(φ) is added to C. Once all matrices in M are determined at block 604 to be similar (and, therefore, orthogonal), the method 600 terminates.

Multiframe Simulation

Although a single frame

is sufficient to represent a stabilizer-state superposition |Ψ

, it is possible to tame the exponential growth of states in |Ψ

in some circumstances by admitting a multiframe representation. A multiframe representation reduces the total number of states required to represent |Ψ

by at least half, thus improving the scalability of our technique. For example, in simulations of ripple-carry adders, the number of states in |Ψ

grows linearly when multiframes are used but exponentially when a single frame is used. We derive a multiframe representation directly from a single frame

by examining the set of phase vectors and identifying candidate pairs that can be coalesced into a single phase vector associated with a different stabilizer matrix

. We maintain the stabilizer matrix

of frame

in row-echelon form, so examining the phases corresponding to Z_(j) rows (i.e., rows with a Z literal in the i^(th) column and I literals elsewhere allows us to identify the columns in

that must be modified in order to coalesce candidate pairs.

FIG. 8 illustrates an exemplary multiframe representation of a state |Ψ

=|000

+|010

+|100

+|100

. The stabilizer matrix

¹ is obtained from stabilizer matrix

by conjugating the first column of

by an H gate. The stabilizer matrix

² is obtained from stabilizer matrix

by first conjugating the first column of

by an H gate, then conjugating the first and third columns of modified

by a CNOT gate. The output of this coalescing process is a list of frames

₁ and

₁ that together represent the same superposition as the original frame

. To facilitate quantum measurements on multiframes as the sum of normalized outcome probabilities as discussed above, we require that the stabilizer frames that represent a superposition of stabilizer states remain mutually orthogonal during simulation. Orthogonality may be maintained by selecting only candidate pairs such that the new frames generated from the set of coalesced phase vectors are mutually orthogonal. Generally, a pair of phase vectors

σ_(r)|σ_(j)) from the same n-qubit frame

is a candidate pair if and only if (i) σ_(r) and σ_(j) are equal up to m≦n entries corresponding to Z_(k) rows (where k is the qubit the row stabilizes) and (ii) the amplitudes of the global phases α_(r) and α_(j) corresponding to phase vectors σ_(r) and σ_(j), respectively, are equivalent up to a phase, i.e., α_(r)=i^(d)α_(j) for some {dε{0, 1, 2, 3}. The stabilizer circuit needed to coalesce a candidate pair

σ_(r)|σ_(j)) with m different entries can be defined as C=CNOT_(v) ₁ _(v) ₂ CNOT_(v) ₁ _(v) ₃ . . . CNOT_(v) ₁ _(v) _(m) R_(V) ₁ ^(d) H_(v) ₁ where each ν_(k)εν={ν₁, ν₂, . . . , ν_(m)} designates the qubit stabilized by the m different entries in the candidate pair

σ_(r)|σ_(j)

.

To coalesce the candidate pairs of the frame

into a multiframe representation, the phase vectors σ_(i) are sorted such that candidate pairs

σ_(r)|σ_(j)

are positioned next to each other. Then, the following two steps are repeated until no candidate pairs remain. First, coalesce candidate pairs into a new set of phase vectors σ′. Next, create a new frame

′ consisting of the phase vectors σ′ and the stabilizer matrix C

C†. The output of this coalescing procedure is a list of n-qubit frame

={

′₁,

′₂, . . . ,

′_(s)} that together represent the same superposition as the original input frame

. The runtime of the coalescing procedure is dominated by the sorting of the phase vectors, where each phase-vector comparison takes Θ(n) time. Therefore, the overall run time is O(nk log k) in the worst case for a single frame

with k phase vectors.

To simulate stabilizer, TOF, controlled-R(α), and measurement gates using multiframes, the single-frame operations are applied to each frame separately as discussed above. For TOF and controlled-R(α) gates, the following additional steps may be required. First, apply the coalescing procedure to each frame and insert the newly coalesced frames into the list

′. Second, merge frames in

′ with equivalent stabilizer matrices

. Then, repeat the first and second steps until no new frames are generated.

Parallel Simulation Using Frames

Unlike other techniques based on compact representations of quantum states, the frame-based operations described herein lend themselves to multi-threaded implementation for parallel simulation. Only the orthogonalization procedure creates a bottleneck by requiring operations involving multiple frames. The other processes and methods described above may be implemented by one or more processors of a classical computer executing instructions pertaining to one of a number of frames or phase vectors. Thus, the efficiency of processing and memory usage of the classical computer system may be further improved by the following methods.

FIG. 9 illustrates a flow diagram of an exemplary parallel simulation method 900. The method 900 begins at block 902, where the initial basis state |ψ

is received by the classical computer. In some embodiments, the initial basis state |ψ

may consist of one or more of a deterministic vector of qubits (e.g., |00 . . . 0

), a phase vector σ, a stabilizer matrix

, or a frame

. The initial basis state |ψ

is decomposed into an orthogonal superposition of stabilizer states |Ψ

at block 904 to obtain a stabilizer frame

, using the techniques described above. In some embodiments, the stabilizer frame

may also be divided into a list of stabilizer frames

={

′₁,

′₂, . . . ,

′_(s)} and stored as input to the iterative simulation process at block 905. The remainder of the method 900 is then implemented by the classical computer to iteratively apply a quantum circuit C including a number of quantum gates U E C to the list of stabilizer frames

={

′₁,

′₂, . . . ,

′_(s)} in block 905. At block 906, the classical computer determines whether any gates UεC remain to be simulated. While at least one gate U remains, the classical computer determines whether the gate U is a stabilizer gate (e.g., H, R, or CNOT) at block 908. If gate U is a stabilizer gate, then the gate is applied to all frames in

and the list of stabilizer frames

={

′₁,

′₂, . . . ,

′_(s)} is updated at block 910. The updated list of stabilizer frames may then be stored at block 905 and used as the input in the next iteration of the process. If gate U is not a stabilizer gate, then the classical computer determines whether the gate U is a measurement gate at block 912. Where gate U is a measurement gate, the classical computer determines the outcome state at block 912 and may record the measurement results at block 916. In some embodiments, a random number generator or other known methods of sampling a random distribution to determine a discrete outcome from a probability distribution may be used to determine a discrete outcome at block 914, as discussed above. After determining the outcome state at block 914, the results of measurement may be used to update the list of stabilizer frames at block 910.

Where the gate U is neither a stabilizer gate nor a measurement gate, the iteration continues by applying the gate U to each frame in the list of stabilizer frames at block 918 using the frame-based simulation techniques discussed above, expanding the set of phase vectors in each frame in

. The global phase may be maintained during simulation of non-stabilizer gates (e.g, Toffoli or controlled-R(α) gates) using the techniques discussed with respect to method 500. Following application of the gate U to each frame, candidate pairs of phase vectors σ in each frame in the list are coalesced into new frames at block 920. Frames with equivalent matrices are then merged to eliminate redundancies at block 922. The classical computer may then determine whether to continue the coalescing procedure at block 924 by determining whether any candidate pairs remain, as discussed above. When all frames in

have been coalesced, the classical computer next determines whether the frames in

are orthogonal at block 926. Orthogonality of the stabilizer matrices

^(i)εM corresponding to the frames

_(i) in

may be determined using known methods (e.g., inner product computation). In some embodiments, the canonical structure of the stabilizer matrices in

may be used to reduce the number of matrix comparisons required. Where the set P of Pauli operators that form the intersection of rows across matrices in M is non-empty, the orthogonality of any two matrices in M may be determined by checking whether the phase vector entries corresponding to the set P of Pauli operators that form the intersection of rows across two matrices are different. Where the frames are determined not to be orthogonal, they can be made orthogonal using the orthogonalization method 600 described above. Once all frames are orthogonal, the list of stabilizer frames

={

′₁,

′₂, . . . ,

′_(s)} is updated at block 910. When no gates remain to be applied at block 906, the method 900 terminates.

Implementation Using a Classical Computer

The preceding methods are designed to be implemented by a classical computer to simulate the operation of a quantum computer, which is advantageous in the design and testing of quantum circuits and algorithms. The matrix, vector, and logic operations discussed herein may be performed on a classical computer, including specialized computing systems or commercially available personal computers, laptop computers, servers, or mainframes. The operations performed by the classical computer may also be performed by a program or programs implemented on one or more computers. In some embodiments, some or all of the operations may be performed by more than one computer communicatively connected through a network.

FIG. 10 illustrates an exemplary block diagram of a computer system 1000 on which the methods and techniques described herein may be implemented in accordance with the described embodiments. The computer system 1000 includes a computing device in the form of a computer 1010. Components of the computer 1010 may include, but are not limited to, a processing unit 1020, a system memory 1030, and a system bus 1021 that couples various system components including the system memory to the processing unit 1020. The system bus 1021 may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include the Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus (also known as Mezzanine bus).

Computer 1010 typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computer 1010 and includes both transitory and non-transitory media, and both removable and non-removable media. By way of example, and not limitation, computer readable media may include non-transitory computer storage media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules, or other data. Non-transitory computer storage media includes, but is not limited to, RAM, ROM, EEPROM, FLASH memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by computer 1010.

The system memory 1030 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 1031 and random access memory (RAM) 1032. A basic input/output system 1033 (BIOS), containing the basic routines that help to transfer information between elements within computer 1010, such as during start-up, is typically stored in ROM 1031. RAM 1032 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 1020. By way of example, and not limitation, FIG. 10 illustrates operating system 1034, application programs 1035, other program modules 1036, and program data 1037.

The computer 1010 may also include other removable or non-removable, volatile or nonvolatile computer storage media. By way of example only, FIG. 10 illustrates a hard disk drive 1041 that reads from or writes to non-removable, nonvolatile magnetic media, a magnetic disk drive 1051 that reads from or writes to a removable, nonvolatile magnetic disk 1052, and an optical disk drive 1055 that reads from or writes to a removable, nonvolatile optical disk 1056 such as a CD ROM or other optical media. Other removable or non-removable, volatile or nonvolatile computer storage media that can be used in the exemplary operating environment include, but are not limited to, magnetic tape cassettes, flash memory cards, digital versatile disks, digital video tape, solid state RAM, solid state ROM, and the like. The hard disk drive 1041 is typically connected to the system bus 1021 through a non-removable memory interface such as interface 1040, and magnetic disk drive 1051 and optical disk drive 1055 are typically connected to the system bus 1021 by a removable memory interface, such as interface 1050.

The drives and their associated computer storage media discussed above and illustrated in FIG. 10 provide storage of computer readable instructions, data structures, program modules and other data for the computer 1010. In FIG. 10, for example, hard disk drive 1041 is illustrated as storing operating system 1044, application programs 1045, other program modules 1046, and program data 1047. Note that these components can either be the same as or different from operating system 1034, application programs 1035, other program modules 1036, and program data 1037. Operating system 1044, application programs 1045, other program modules 1046, and program data 1047 are given different numbers here to illustrate that, at a minimum, they are different copies. A user may enter commands and information into the computer 1010 through input devices such as a keyboard 1062 and cursor control device 1061, commonly referred to as a mouse, trackball or touch pad. A monitor 1091 or other type of display device is also connected to the system bus 1021 via an interface, such as a graphics controller 1090. In addition to the monitor, computers may also include other peripheral output devices such as printer 1096, which may be connected through an output peripheral interface 1095.

The computer 1010 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 1080. The remote computer 1080 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 1010, although only a memory storage device 1081 has been illustrated in FIG. 10. The logical connections depicted in FIG. 10 include a local area network (LAN) 1071 and a wide area network (WAN) 1073, but may also include other networks.

When used in a LAN networking environment, the computer 1010 is connected to the LAN 1071 through a network interface or adapter 1070. When used in a WAN networking environment, the computer 1010 typically includes a modem 1072 or other means for establishing communications over the WAN 1073, such as the Internet. The modem 1072, which may be internal or external, may be connected to the system bus 1021 via the input interface 1060, or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer 1010, or portions thereof, may be stored in the remote memory storage device 1081. By way of example, and not limitation, FIG. 10 illustrates remote application programs 1085 as residing on memory device 1081.

The communications connections 1070, 1072 allow the device to communicate with other devices. The communications connections 1070, 1072 are an example of communication media. The communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. A “modulated data signal” may be a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media.

Throughout this specification, plural instances may implement components, operations, or structures described as a single instance. Although individual operations of one or more methods are illustrated and described as separate operations, one or more of the individual operations may be performed concurrently, and may, where appropriate, be performed in an order other than the order illustrated. Structures and functionality presented as separate components in example configurations may be implemented as a combined structure or component. Similarly, structures and functionality presented as a single component may be implemented as separate components. These and other variations, modifications, additions, and improvements fall within the scope of the subject matter herein.

The various operations of example methods described herein may be performed, at least partially, by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform the relevant operations. Whether temporarily or permanently configured, such processors may constitute processor-implemented modules that operate to perform one or more operations or functions. The modules referred to herein may, in some example embodiments, comprise processor-implemented modules. Although the term “processor” may include central processing units (CPUs), it may also include equivalent general or special-purpose circuits, such as field programmable gate arrays (FPGAs) or graphics processing units (GPUs).

Similarly, the methods or routines described herein may be at least partially processor-implemented. For example, at least some of the operations of a method may be performed by one or more processors or processor-implemented hardware modules. The performance of certain of the operations may be distributed among the one or more processors, not only residing within a single machine, but deployed across a number of machines. In some example embodiments, the processor or processors may be located in a single location, while in other embodiments the processors may be distributed across a number of locations.

Unless specifically stated otherwise, discussions herein using words such as “processing,” “computing,” “calculating,” “determining,” “presenting,” “displaying,” or the like may refer to actions or processes of a machine (e.g., a computer) that manipulates or transforms data represented as physical (e.g., electronic, magnetic, or optical) quantities within one or more memories (e.g., volatile memory, non-volatile memory, or a combination thereof), registers, or other machine components that receive, store, transmit, or display information.

As used herein any reference to “one embodiment” or “an embodiment” means that a particular element, feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.

Some embodiments may be described using the expression “coupled” and “connected” along with their derivatives. For example, some embodiments may be described using the term “coupled” to indicate that two or more elements are in direct physical or electrical contact. The term “coupled,” however, may also mean that two or more elements are not in direct contact with each other, but yet still co-operate or interact with each other. The embodiments are not limited in this context.

As used herein, the terms “comprises,” “comprising,” “includes,” “including,” “has,” “having” or any other variation thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, article, or apparatus that comprises a list of elements is not necessarily limited to only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Further, unless expressly stated to the contrary, “or” refers to an inclusive or and not to an exclusive or. For example, a condition A or B is satisfied by any one of the following: A is true (or present) and B is false (or not present), A is false (or not present) and B is true (or present), and both A and B are true (or present).

In addition, use of the “a” or “an” are employed to describe elements and components of the embodiments herein. This is done merely for convenience and to give a general sense of the description. This description, and the claims that follow, should be read to include one or at least one and the singular also includes the plural unless it is obvious that it is meant otherwise.

This detailed description is to be construed as exemplary only and does not describe every possible embodiment, as describing every possible embodiment would be impractical, if not impossible. One could implement numerous alternate embodiments, using either current technology or technology developed after the filing date of this application.

Upon reading this disclosure, those of skill in the art will appreciate still additional alternative structural and functional designs for system and a method for assigning mobile device data to a vehicle through the disclosed principles herein. Thus, while particular embodiments and applications have been illustrated and described, it is to be understood that the disclosed embodiments are not limited to the precise construction and components disclosed herein. Various modifications, changes and variations, which will be apparent to those skilled in the art, may be made in the arrangement, operation and details of the method and apparatus disclosed herein without departing from the spirit and scope defined in the appended claims.

The particular features, structures, or characteristics of any specific embodiment may be combined in any suitable manner and in any suitable combination with one or more other embodiments, including the use of selected features without corresponding use of other features. In addition, many modifications may be made to adapt a particular application, situation or material to the essential scope and spirit of the present invention. It is to be understood that other variations and modifications of the embodiments of the present invention described and illustrated herein are possible in light of the teachings herein and are to be considered part of the spirit and scope of the present invention. By way of example, and not limitation, the present disclosure contemplates at least the following aspects:

1. A method for maintaining global phases to improve processing efficiency or reduce memory usage during simulation of at least one quantum gate of a quantum computer using a classical computer, the method comprising: receiving, at a processor of the classical computer, a quantum state that is a superposition of a plurality of stabilizer states, wherein the quantum state is represented by a stabilizer matrix associated with the plurality of stabilizer states, a plurality of phase vectors representing each of the stabilizer states, and an amplitude vector, wherein each entry in the amplitude vector represents a global phase associated with one of the plurality of phase vectors; receiving, at a processor of the classical computer, a matrix representation of the at least one quantum gate; and determining, by a processor of the classical computer, the effect of the at least one quantum gate on the quantum state in a plurality of iterations, each iteration including: applying, by a processor of the classical computer, one of the plurality of phase vectors to the stabilizer matrix; determining, by a processor of the classical computer, an input basis state associated with the one phase vector applied to the stabilizer matrix; determining, by a processor of the classical computer, an input non-zero amplitude associated with the input basis state; determining, by a processor of the classical computer, a first output non-zero amplitude associated with an output basis state by applying the matrix representation of the at least one quantum gate to the input non-zero amplitude and the input basis state; determining, by a processor of the classical computer, a second output non-zero amplitude of the output basis state using the stabilizer matrix and the matrix representation of the at least one quantum gate; and adjusting, by a processor of the classical computer, the entry in the amplitude vector associated with the one phase vector applied to the stabilizer matrix, wherein the entry is adjusted proportionally to the first output non-zero amplitude and the second output non-zero amplitude.

2. The method according to aspect 1, wherein at least one quantum gate of the quantum computer is not a stabilizer gate.

3. The method according to either of aspect 1 or aspect 2, wherein a set of the quantum gates form a universal set for quantum computation.

4. The method according to any one of the preceding aspects, wherein the stabilizer matrix is in canonical form.

5. The method according to any one of the preceding aspects, wherein: receiving the quantum state that is a superposition of the plurality of stabilizer states further comprises compressing, by a processor of the classical computer, the quantum state into a stabilizer frame representing the quantum state, wherein the stabilizer frame includes the stabilizer matrix, the plurality of phase vectors, and the amplitude vector, and the method further comprises determining, by a processor of the classical computer, the effect of a plurality of the quantum gates on the quantum state using the stabilizer frame without uncompressing the stabilizer frame for measurement until the plurality of quantum gates have been applied to the quantum state.

6. A tangible, non-transitory computer-readable medium storing instructions for maintaining global phases to improve processing efficiency or reduce memory usage during simulation of at least one quantum gate of a quantum computer using a classical computer that, when executed by one or more processors of the classical computer, cause the classical computer to: receive a quantum state that is a superposition of a plurality of stabilizer states, wherein the quantum state is represented by a stabilizer matrix associated with the plurality of stabilizer states, a plurality of phase vectors representing each of the stabilizer states, and an amplitude vector, wherein each entry in the amplitude vector represents a global phase associated with one of the plurality of phase vectors; receive a matrix representation of the at least one quantum gate; and determine the effect of the at least one quantum gate on the quantum state in a plurality of iterations, each iteration including instructions to: apply one of the plurality of phase vectors to the stabilizer matrix; determine an input basis state associated with the one phase vector applied to the stabilizer matrix; determine an input non-zero amplitude associated with the input basis state; determine a first output non-zero amplitude associated with an output basis state by applying the matrix representation of the at least one quantum gate to the input non-zero amplitude and the input basis state; determine a second output non-zero amplitude of the output basis state using the stabilizer matrix and the matrix representation of the at least one quantum gate; and adjust the entry in the amplitude vector associated with the one phase vector applied to the stabilizer matrix, wherein the entry is adjusted proportionally to the first output non-zero amplitude and the second output non-zero amplitude.

7. The tangible, non-transitory computer-readable medium according to aspect 6, wherein at least one quantum gate of the quantum computer is not a stabilizer gate.

8. The tangible, non-transitory computer-readable medium according to either of aspect 6 or aspect 7, wherein the stabilizer matrix is in reduced row-echelon form.

9. The tangible, non-transitory computer-readable medium according to any one of aspects 6-8, wherein the executable instructions that when executed by the one or more processors cause the classical computer to receive the quantum state that is a superposition of the plurality of stabilizer states further comprise executable instructions that when executed by the one or more processors cause the classical computer to compress the quantum state into a stabilizer frame representing the quantum state, wherein the stabilizer frame includes the stabilizer matrix, the plurality of phase vectors, and the amplitude vector; and further comprising executable instructions that when executed by the one or more processors cause the classical computer to determine the effect of a plurality of the quantum gates on the quantum state using the stabilizer frame without uncompressing the stabilizer frame for measurement until the plurality of quantum gates have been applied to the quantum state.

10. The tangible, non-transitory computer-readable medium according to any one of aspects 6-9, wherein the stabilizer frame further comprises a linear combination of a plurality of mutually orthogonal stabilizer frames.

11. A method for orthogonalization of a linear combination of stabilizer states to improve processing efficiency or reduce memory usage during simulation of a quantum circuit using a classical computer, the method comprising: receiving, at a processor of the classical computer, a linear combination of stabilizer states, wherein the linear combination includes a plurality of stabilizer states represented by canonical stabilizer matrices and a plurality of coefficients associated with the plurality of stabilizer states; and orthogonalizing, by a processor of the classical computer, the linear combination of stabilizer states in each of one or more iterations, including: identifying, by a processor of the classical computer, a column in which at least two of the canonical stabilizer matrices contain different types of Pauli literals; decomposing, by a processor of the classical computer, each of the stabilizer matrices that contain an X or Y Pauli literal in the identified column into a first matrix and a second matrix, wherein the first matrix and the second matrix represent stabilizer states that are nearest neighbors of the stabilizer state associated with the decomposed stabilizer matrix; determining, by a processor of the classical computer, a first global phase factor of the first matrix and a second global phase factor of the second matrix associated with each of the decomposed stabilizer matrices; and replacing, by a processor of the classical computer, each of the decomposed stabilizer matrices and their associated coefficients with (i) the first matrix and a first coefficient proportionate to the first global phase factor associated with the decomposed stabilizer matrix and (ii) the second matrix and a second coefficient proportionate to the second global phase factor associated with the decomposed stabilizer matrix.

12. The method according to aspect 11, wherein: at least one of the quantum gates is a measurement gate, and determining the effect of the measurement gate comprises determining, by a processor of the classical computer, an outcome probability of a state using normalized outcome probabilities of the state in each of the frames.

13. The method according to either of aspect 11 or aspect 12, wherein: at least one of the quantum gates is a measurement gate, and determining the effect of the measurement gate comprises determining, using a processor of the classical computer, an outcome probability of a state using normalized outcome probabilities of the state in each of the frames.

14. The method according to any one of aspects 11-13, wherein the method is implemented in parallel on at least two groups, with each of the groups containing at least one of the stabilizer frames.

15. The method according to any one of aspects 11-14, wherein at least one of the quantum gates is not a stabilizer gate.

16. A tangible, non-transitory computer-readable medium storing instructions for orthogonalization of a linear combination of stabilizer states to improve processing efficiency or reduce memory usage during simulation of a quantum circuit using a classical computer that, when executed by one or more processors of the classical computer, cause the classical computer to: receive a linear combination of stabilizer states, wherein the linear combination includes a plurality of stabilizer states represented by canonical stabilizer matrices and a plurality of coefficients associated with the plurality of stabilizer states; and orthogonalize the linear combination of stabilizer states in each of one or more iterations, including instructions to: identify a column in which at least two of the canonical stabilizer matrices contain different types of Pauli literals; decompose each of the stabilizer matrices that contain an X or Y Pauli literal in the identified column into a first matrix and a second matrix, wherein the first matrix and the second matrix represent stabilizer states that are nearest neighbors of the stabilizer state associated with the decomposed stabilizer matrix; determine a first global phase factor of the first matrix and a second global phase factor of the second matrix associated with each of the decomposed stabilizer matrices; and replace each of the decomposed stabilizer matrices and their associated coefficients with (i) the first matrix and a first coefficient proportionate to the first global phase factor associated with the decomposed stabilizer matrix and (ii) the second matrix and a second coefficient proportionate to the second global phase factor associated with the decomposed stabilizer matrix.

17. The tangible, non-transitory computer-readable medium according to aspect 16, wherein the instructions to decompose each of the stabilizer matrices further comprise instructions to (i) identify a row in the stabilizer matrix that contains an X or Y Pauli literal in the identified column, (ii) cause every other row in the stabilizer matrix that commutes with the identified row to anticommute with the identified row, (iii) create the first matrix from the revised stabilizer matrix by replacing the row with a first new row containing a positive Z Pauli literal in the identified column, and (iv) create the second matrix from the revised stabilizer matrix by replacing the row with a second new row containing a negative Z Pauli literal in the identified column.

18. The tangible, non-transitory computer-readable medium according to either of aspect 16 or aspect 17, wherein the linear combination of stabilizer states comprises a linear combination of stabilizer frames representing a quantum state, and further comprising executable instructions that when executed by the one or more processors cause the classical computer to determine the effect of at least one quantum gate on the linear combination of stabilizer states by applying a matrix representation of the quantum gate to each of the stabilizer frames.

19. The tangible, non-transitory computer-readable medium according to any one of aspects 16-18, wherein at least one of the quantum gates is a measurement gate, and the executable instructions that when executed by the one or more processors cause the classical computer to determine the effect of at least one quantum gate on the linear combination of stabilizer states further comprise executable instructions that when executed by the one or more processors cause the classical computer to determine an outcome probability of a state using normalized outcome probabilities of the state in each of the frames.

20. The tangible, non-transitory computer-readable medium according to any one of aspects 16-19, wherein at least one of the quantum gates is not a stabilizer gate. 

What is claimed is:
 1. A method for maintaining global phases during simulation of at least one quantum gate of a quantum computer using a classical computer, the method comprising: receiving, at a processor of the classical computer, a quantum state that is a superposition of a plurality of stabilizer states, wherein the quantum state is represented by a stabilizer matrix associated with the plurality of stabilizer states, a plurality of phase vectors representing each of the stabilizer states, and an amplitude vector, wherein each entry in the amplitude vector represents a global phase associated with one of the plurality of phase vectors; receiving, at a processor of the classical computer, a matrix representation of the at least one quantum gate; and determining, by a processor of the classical computer, the effect of the at least one quantum gate on the quantum state in a plurality of iterations, each iteration including: applying, by a processor of the classical computer, one of the plurality of phase vectors to the stabilizer matrix; determining, by a processor of the classical computer, an input basis state associated with the one phase vector applied to the stabilizer matrix; determining, by a processor of the classical computer, an input non-zero amplitude associated with the input basis state; determining, by a processor of the classical computer, a first output non-zero amplitude associated with an output basis state by applying the matrix representation of the at least one quantum gate to the input non-zero amplitude and the input basis state; determining, by a processor of the classical computer, a second output non-zero amplitude of the output basis state using the stabilizer matrix and the matrix representation of the at least one quantum gate; and adjusting, by a processor of the classical computer, the entry in the amplitude vector associated with the one phase vector applied to the stabilizer matrix, wherein the entry is adjusted proportionally to the first output non-zero amplitude and the second output non-zero amplitude.
 2. The method of claim 1, wherein at least one quantum gate of the quantum computer is not a stabilizer gate.
 3. The method of claim 1, wherein a set of the quantum gates form a universal set for quantum computation.
 4. The method of claim 1, wherein the stabilizer matrix is in canonical form.
 5. The method of claim 1, wherein: receiving the quantum state that is a superposition of the plurality of stabilizer states further comprises compressing, by a processor of the classical computer, the quantum state into a stabilizer frame representing the quantum state, wherein the stabilizer frame includes the stabilizer matrix, the plurality of phase vectors, and the amplitude vector, and the method further comprises determining, by a processor of the classical computer, the effect of a plurality of the quantum gates on the quantum state using the stabilizer frame without uncompressing the stabilizer frame for measurement until the plurality of quantum gates have been applied to the quantum state.
 6. A tangible, non-transitory computer-readable medium storing instructions for maintaining global phases during simulation of at least one quantum gate of a quantum computer using a classical computer that, when executed by one or more processors of the classical computer, cause the classical computer to: receive a quantum state that is a superposition of a plurality of stabilizer states, wherein the quantum state is represented by a stabilizer matrix associated with the plurality of stabilizer states, a plurality of phase vectors representing each of the stabilizer states, and an amplitude vector, wherein each entry in the amplitude vector represents a global phase associated with one of the plurality of phase vectors; receive a matrix representation of the at least one quantum gate; and determine the effect of the at least one quantum gate on the quantum state in a plurality of iterations, each iteration including instructions to: apply one of the plurality of phase vectors to the stabilizer matrix; determine an input basis state associated with the one phase vector applied to the stabilizer matrix; determine an input non-zero amplitude associated with the input basis state; determine a first output non-zero amplitude associated with an output basis state by applying the matrix representation of the at least one quantum gate to the input non-zero amplitude and the input basis state; determine a second output non-zero amplitude of the output basis state using the stabilizer matrix and the matrix representation of the at least one quantum gate; and adjust the entry in the amplitude vector associated with the one phase vector applied to the stabilizer matrix, wherein the entry is adjusted proportionally to the first output non-zero amplitude and the second output non-zero amplitude.
 7. The tangible, non-transitory computer-readable medium of claim 6, wherein at least one quantum gate of the quantum computer is not a stabilizer gate.
 8. The tangible, non-transitory computer-readable medium of claim 6, wherein the stabilizer matrix is in reduced row-echelon form.
 9. The tangible, non-transitory computer-readable medium of claim 6, wherein the executable instructions that when executed by the one or more processors cause the classical computer to receive the quantum state that is a superposition of the plurality of stabilizer states further comprise executable instructions that when executed by the one or more processors cause the classical computer to compress the quantum state into a stabilizer frame representing the quantum state, wherein the stabilizer frame includes the stabilizer matrix, the plurality of phase vectors, and the amplitude vector; and further comprising executable instructions that when executed by the one or more processors cause the classical computer to determine the effect of a plurality of the quantum gates on the quantum state using the stabilizer frame without uncompressing the stabilizer frame for measurement until the plurality of quantum gates have been applied to the quantum state.
 10. The tangible, non-transitory computer-readable medium of claim 9, wherein the stabilizer frame further comprises a linear combination of a plurality of mutually orthogonal stabilizer frames.
 11. A method for orthogonalization of a linear combination of stabilizer states during simulation of a quantum circuit using a classical computer, the method comprising: receiving, at a processor of the classical computer, a linear combination of stabilizer states, wherein the linear combination includes a plurality of stabilizer states represented by canonical stabilizer matrices and a plurality of coefficients associated with the plurality of stabilizer states; and orthogonalizing, by a processor of the classical computer, the linear combination of stabilizer states in each of one or more iterations, including: identifying, by a processor of the classical computer, a column in which at least two of the canonical stabilizer matrices contain different types of Pauli literals; decomposing, by a processor of the classical computer, each of the stabilizer matrices that contain an X or Y Pauli literal in the identified column into a first matrix and a second matrix, wherein the first matrix and the second matrix represent stabilizer states that are nearest neighbors of the stabilizer state associated with the decomposed stabilizer matrix; determining, by a processor of the classical computer, a first global phase factor of the first matrix and a second global phase factor of the second matrix associated with each of the decomposed stabilizer matrices; and replacing, by a processor of the classical computer, each of the decomposed stabilizer matrices and their associated coefficients with (i) the first matrix and a first coefficient proportionate to the first global phase factor associated with the decomposed stabilizer matrix and (ii) the second matrix and a second coefficient proportionate to the second global phase factor associated with the decomposed stabilizer matrix.
 12. The method of claim 11, wherein: the linear combination of stabilizer states comprises a linear combination of stabilizer frames representing a quantum state, and the method further comprises determining, by a processor of the classical computer, the effect of at least one quantum gate on the linear combination of stabilizer states by applying a matrix representation of the quantum gate to each of the stabilizer frames.
 13. The method of claim 12, wherein: at least one of the quantum gates is a measurement gate, and determining the effect of the measurement gate comprises determining, by a processor of the classical computer, an outcome probability of a state using normalized outcome probabilities of the state in each of the frames.
 14. The method of claim 12, wherein the method is implemented in parallel on at least two groups, with each of the groups containing at least one of the stabilizer frames.
 15. The method of claim 12, wherein at least one of the quantum gates is not a stabilizer gate.
 16. A tangible, non-transitory computer-readable medium storing instructions for orthogonalization of a linear combination of stabilizer states during simulation of a quantum circuit using a classical computer that, when executed by one or more processors of the classical computer, cause the classical computer to: receive a linear combination of stabilizer states, wherein the linear combination includes a plurality of stabilizer states represented by canonical stabilizer matrices and a plurality of coefficients associated with the plurality of stabilizer states; and orthogonalize the linear combination of stabilizer states in each of one or more iterations, including instructions to: identify a column in which at least two of the canonical stabilizer matrices contain different types of Pauli literals; decompose each of the stabilizer matrices that contain an X or Y Pauli literal in the identified column into a first matrix and a second matrix, wherein the first matrix and the second matrix represent stabilizer states that are nearest neighbors of the stabilizer state associated with the decomposed stabilizer matrix; determine a first global phase factor of the first matrix and a second global phase factor of the second matrix associated with each of the decomposed stabilizer matrices; and replace each of the decomposed stabilizer matrices and their associated coefficients with (i) the first matrix and a first coefficient proportionate to the first global phase factor associated with the decomposed stabilizer matrix and (ii) the second matrix and a second coefficient proportionate to the second global phase factor associated with the decomposed stabilizer matrix.
 17. The tangible, non-transitory computer-readable medium of claim 16, wherein the instructions to decompose each of the stabilizer matrices further comprise instructions to (i) identify a row in the stabilizer matrix that contains an X or Y Pauli literal in the identified column, (ii) cause every other row in the stabilizer matrix that commutes with the identified row to anticommute with the identified row, (iii) create the first matrix from the revised stabilizer matrix by replacing the row with a first new row containing a positive Z Pauli literal in the identified column, and (iv) create the second matrix from the revised stabilizer matrix by replacing the row with a second new row containing a negative Z Pauli literal in the identified column.
 18. The tangible, non-transitory computer-readable medium of claim 16, wherein the linear combination of stabilizer states comprises a linear combination of stabilizer frames representing a quantum state, and further comprising executable instructions that when executed by the one or more processors cause the classical computer to determine the effect of at least one quantum gate on the linear combination of stabilizer states by applying a matrix representation of the quantum gate to each of the stabilizer frames.
 19. The tangible, non-transitory computer-readable medium of claim 18, wherein at least one of the quantum gates is a measurement gate, and the executable instructions that when executed by the one or more processors cause the classical computer to determine the effect of at least one quantum gate on the linear combination of stabilizer states further comprise executable instructions that when executed by the one or more processors cause the classical computer to determine an outcome probability of a state using normalized outcome probabilities of the state in each of the frames.
 20. The tangible, non-transitory computer-readable medium of claim 18, wherein at least one of the quantum gates is not a stabilizer gate. 